<template>
  <div>
     <!-- <kt-button :label="$t('action.batchDelete')" :perms="permsDelete" :size="size" type="danger" @click="handleBatchDelete()" 
        :disabled="this.selections.length===0" style="float:left;" v-if="showBatchDelete & showOperation & check"/> -->
    <!--表格栏-->
    
    <el-table :data="data.content" :highlight-current-row="highlightCurrentRow" @selection-change="selectionChange" 
          @current-change="handleCurrentChange" @sort-change="sortChange" @cell-click="handleCellClick"  v-loading="loading" :element-loading-text="$t('action.loading')" :border="border" :stripe="stripe"
          :max-height="maxHeight" :size="size" :align="align" style="width:100%;"  :row-style="rowStyle" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :row-key="rowKey">
      <el-table-column type="selection" :reserve-selection="reserveSelection" v-if="showBatchDelete & showOperation"></el-table-column>
      <el-table-column v-for="column in columns" header-align="center" align="center"
      :show-overflow-tooltip="showOverflowTooltip"
        :prop="column.prop" :label="column.label" :width="column.width" :min-width="column.minWidth" :sortable="column.sortable!=null?true:column.sortable"
          :fixed="column.fixed" :key="column.prop" :type="column.type" v-if="!column.customerSource||column.customerImportDepartment" :formatter="column.formatter">
        <!-- 去掉排序 -->
        <!-- :fixed="column.fixed" :key="column.prop" :type="column.type" :sortable="column.sortable==null?true:column.sortable"> -->
      </el-table-column>
      <!-- 客户管理  学生客户 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&customerstu" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('customer:student:switch')"
              class="demo" 
              :active-text="test1"
              :inactive-text="test2" 
              v-model="scope.row.isLock"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='2' inactive-value='1'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>
          <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.Follow')" :perms="permsFollow" :size="size" @click="handleFollow(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 客户归属  到期分中心资源 -->
      <el-table-column :label="$t('action.operation')" width='50' fixed="right" v-if="showOperation&ExpireSubcenter" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 客户管理  网校校客户 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&customerChinaedu" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('customer:chinaedu:switch')"
              class="demo" 
              :active-text="test1"
              :inactive-text="test2" 
              v-model="scope.row.lockStatus"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='1' inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>  
          <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <!-- <el-button type="text" :perms="permsSee"  @click="handleSee(scope.$index, scope.row)">查看</el-button>
          <el-button type="text" :perms="permsEdit"  @click="handleEdit(scope.$index, scope.row)">修改</el-button> -->
          <!-- <kt-button :label="$t('action.see')" :perms="permsSee"  :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" /> -->
        </template>
      </el-table-column>
      <!-- 客户管理  学酷客户 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&customerxuecoo" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              class="demo" 
              v-if="hasPerms('customer:xuecoo:switch')"
              :active-text="test1"
              :inactive-text="test2" 
              v-model="scope.row.lockStatus"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='1' inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>  
          <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <!-- <el-button type="text" :perms="permsSee"  @click="handleSee(scope.$index, scope.row)">查看</el-button>
          <el-button type="text" :perms="permsEdit"  @click="handleEdit(scope.$index, scope.row)">修改</el-button> -->
          <!-- <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" /> -->
        </template>
      </el-table-column>
      <!-- 资源划分  学生 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&ResourceDivisionstu" header-align="center" align="center">
        <template slot-scope="scope">
        <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 资源划分   网校 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&ResourceDivisionchinaedu" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 资源划分   学酷 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&ResourceDivisionxuecoo" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 客户分配  学生 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&customerdistributionstu" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 客户分配  网校 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&CustomerdistributionChinaedu" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 客户分配  学酷 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&CustomerdistributionXuecoo" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 查看学生客户  跟进情况 查看按钮-->
      <el-table-column :label="$t('action.see')" width='200' fixed="right" v-if="showOperation&see" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms="customerdistribution:xuecoo:see" :size="size" @click="handleFollow(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 客户归属  分中心分配策略-->
      <el-table-column :label="$t('注册资源')" width='100' fixed="right" v-if="showOperation&Subcentercustomer" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('customerownership:subcentercustomer:switch')"
              class="demo" 
              active-text="启用"
              inactive-text="停用" 
              v-model="scope.row.isOpen1"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='1' inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>
        </template>
      </el-table-column>
      <el-table-column :label="$t('所有资源')" width='100' fixed="right" v-if="showOperation&Subcentercustomer" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('customerownership:subcentercustomer:switchall')"
              class="demo" 
              active-text="启用"
              inactive-text="停用" 
              v-model="scope.row.isOpen2"
              @change="changeSwitchs(scope.$index,scope.row)"  
              active-value='1' inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>
        </template>  
      </el-table-column>
      <!-- 客户归属  公海回收分中心配置 -->  
      <el-table-column :label="$t('操作')" width='100' fixed="right" v-if="showOperation&SubcentercustomerSeaConfig" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('customerownership:SubcentercustomerSeaConfig:switch')"
              class="demo" 
              active-text="启用"
              inactive-text="停用" 
              v-model="scope.row.isOpenRecycle"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='1' inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>
        </template>
      </el-table-column>
      <!-- 客户归属  分成配置比-->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="showOperation&Proportioning" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.Proportioning')" :perms="permsProprt"  @click="ProportioningPop(scope.$index, scope.row)"></kt-button>   
        </template>
      </el-table-column>
      <!-- 客户归属  总部学生客户 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="showOperation&HeadquartersStu" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 客户归属  分中心客户 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="showOperation&Subcenter" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 客户归属  分中学生客户公海 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="Subcentercustomersea" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')"  :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
        <!-- 我的客户 学生 客户类型 -->
      <el-table-column label="客户类型" width="70" fixed="right"  align="center" v-if="showOperation&Mycustomerstudent">
        <template slot-scope="scope">
                <span>{{ scope.row.type }}</span>
          </template>
      </el-table-column>
      <!-- 我的客户 代理商 客户类型 -->
      <el-table-column label="客户类型" width="70" fixed="right"  align="center" v-if="showOperation&Mycustomerchianedu">
        <template slot-scope="scope">
                <span>{{ scope.row.customerType }}</span>
          </template>
      </el-table-column>
      <!--我的客户  学生客户 -->
      <el-table-column :label="$t('action.operation')" width='320' fixed="right" v-if="showOperation&Mycustomerstudent" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.Follow')" :perms="permsFollow" :size="size" @click="handleFollow(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('录播课报单')" :perms="permsPresentation" :size="size" @click="handleOrder(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('1对1下单')" :perms="permsCheckOrder" :size="size" @click="handleUp(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('外呼')" :perms="permsOutbound" :size="size" @click="handleoutbound(scope.$index, scope.row)" />
        </template>
      </el-table-column>  
      <!-- 2Ccenter -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="twoCcenter" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" :label="$t('修改独家非独家')" :perms='permsEdit' :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 我的客户 学校 客户类型 -->
      <el-table-column label="审核状态" width="90" fixed="right"  align="center" v-if="showOperation&Mycustomerschool">
        <template slot-scope="scope">
                <span>{{ scope.row.auditStatusStr }}</span>
          </template>
      </el-table-column>
      <el-table-column label="意向程度" width="90" fixed="right"  align="center" v-if="showOperation&Mycustomerschool">
        <template slot-scope="scope">
                <span>{{ scope.row.type }}</span>
          </template>
      </el-table-column>
      <!--我的客户  学校客户 -->
      <el-table-column :label="$t('action.operation')" width='210' fixed="right" v-if="showOperation&Mycustomerschool" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <!-- <kt-button type="text" :disabled="scope.row.type2==4?true:false" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" /> -->
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <!-- <kt-button type="text" :disabled="scope.row.type2==4?true:false" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" /> -->
          <kt-button type="text" :label="$t('action.Follow')" :perms="permsFollow" :size="size" @click="handleFollow(scope.$index, scope.row)" />
          <kt-button type="text"  label="跟进" :perms="permsReport" :size="size"  @click="handleReport(scope.$index, scope.row)" />
          <kt-button type="text" :disabled="(scope.row.auditStatus==2||scope.row.auditStatus==3)?true:false"  label="报备" :perms="permsReport" :size="size" @click="handleAudit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--我的客户  学校客户 -->
      <el-table-column :label="$t('action.operation')" width='210' fixed="right" v-if="showOperation&seeSchoolTracking" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" label="查看跟进详情" perms="true" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      
      <!--我的客户  审核学校 -->
      <el-table-column :label="$t('action.operation')" width='150' fixed="right" v-if="showOperation&SchoolAudit" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text"   label="审核" :perms="permsAudit" :size="size" @click="handleAudit(scope.$index, scope.row)" />
          <kt-button type="text"   label="驳回" :perms="permsAudit" :size="size" @click="handleAudit2(scope.$index, scope.row)" />
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--我的客户  进校资源 -->
      <el-table-column :label="$t('action.operation')" width='50' fixed="right" v-if="showOperation&SchoolResources" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--我的客户  进校成单 -->
      <el-table-column :label="$t('action.operation')" width='80' fixed="right" v-if="showOperation&SchoolResourcesOrder" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :disabled="scope.row.type==1?true:false" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.Follow')" :perms="permsFollow" :size="size" @click="handleFollow(scope.$index, scope.row)" />
          <kt-button type="text"  label="报备" :perms="permsReport" :size="size" @click="handleReport(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 商务合作中心   三方 -->
      <el-table-column :label="$t('action.operation')" width='220' fixed="right" v-if="MyThree"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text"  label="跟进" :perms="permsReport" :size="size"   @click="handleReport(scope.$index, scope.row)" />
          <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 商务合作中心   日报 -->
      <el-table-column :label="$t('action.operation')" width='220' fixed="right" v-if="Daily"  header-align="center" align="center">
        <template slot-scope="scope">
          <!-- <kt-button  type="text" v-if='scope.row.isComplete' :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" /> -->
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--我的客户  网校代理商客户 -->
      <el-table-column :label="$t('action.operation')"  width='200' fixed="right" v-if="showOperation&Mycustomerchianedu" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.Follow')" :perms="permsFollow" :size="size" @click="handleFollow(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('报单')" :perms="permsPresentation" :size="size" @click="handleOrder(scope.$index, scope.row)" />
          <!-- <el-button type="text" :perms="permsSee"  @click="handleSee(scope.$index, scope.row)">查看</el-button>
          <el-button type="text" :perms="permsEdit" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
          <el-button type="text" :perms="permsFollow"  @click="handleFollow(scope.$index, scope.row)">跟进</el-button>
          <el-button type="text" :perms="permsOutbound" @click="handleOrder(scope.$index, scope.row)">报单</el-button> -->
          <!-- <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button :label="$t('action.Follow')" :perms="permsFollow" :size="size"  @click="handleFollow(scope.$index,scope.row)"/>
          <kt-button :label="$t('action.Outbound')" :perms="permsOutbound" :size="size"  @click="handleoutbound(scope.$index, scope.row)"/> -->
        </template>
      </el-table-column>
      <!--客户流转  学生客户 -->
      <!-- <el-table-column :label="$t('action.operation')"  width='200' fixed="right" v-if="showOperation&Mycustomerchianedu" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.Follow')" :perms="permsFollow" :size="size" @click="handleFollow(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('报单')" :perms="permsPresentation" :size="size" @click="handleOrder(scope.$index, scope.row)" />
        </template>
      </el-table-column> -->
      <!-- 我的客户 代理商 客户类型 -->
      <el-table-column label="客户类型" width="70" fixed="right"  align="center" v-if="showOperation&Mycustomerxuecoo">
        <template slot-scope="scope">
                <span>{{ scope.row.customerType }}</span>
          </template>
      </el-table-column>
      <!--我的客户  学酷代理商客户 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="showOperation&Mycustomerxuecoo" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.Follow')" :perms="permsFollow" :size="size" @click="handleFollow(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('报单')" :perms="permsPresentation" :size="size" @click="handleOrder(scope.$index, scope.row)" />
          <!-- <el-button type="text" :perms="permsSee"  @click="handleSee(scope.$index, scope.row)">查看</el-button>
          <el-button type="text" :perms="permsEdit" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
          <el-button type="text" :perms="permsFollow"  @click="handleFollow(scope.$index, scope.row)">跟进</el-button>
          <el-button type="text" :perms="permsOutbound" @click="handleOrder(scope.$index, scope.row)">报单</el-button> -->
          <!-- <kt-button :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button :label="$t('action.Follow')" :perms="permsFollow" :size="size"  @click="handleFollow(scope.$index,scope.row)"/>
          <kt-button :label="$t('action.Outbound')" :perms="permsOutbound" :size="size"  @click="handleoutbound(scope.$index, scope.row)"/> -->
        </template>
      </el-table-column>
      <!-- 我的客户 招商经理推广资源池 -->
      <el-table-column :label="$t('action.operation')" width='180' fixed="right" v-if="showOperation&PersonPromoteAgent" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" :disabled="scope.row.type==1?true:false" :label="$t('action.modify')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.Follow')" :perms="permsFollow" :size="size" @click="handleFollow(scope.$index, scope.row)" />
          <kt-button type="text"  label="报备" :perms="permsReport" :size="size" @click="handleReport(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--客户跟进日志  学生客户 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="showOperation&CustomerFollowlogstu" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
        <!--客户跟进日志  学校客户 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="showOperation&CustomerFollowlogschool" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleFollow(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--客户跟进日志  网校客户 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="showOperation&CustomerFollowlogchinaedu" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleFollow(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--客户跟进日志  学酷客户 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="showOperation&CustomerFollowlogxuecoo" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleFollow(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--客户公海  学生客户 -->
      <el-table-column :label="$t('action.operation')" width='150' fixed="right" v-if="studentCustomerSea" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.Receive')"  :perms="permsReceive" :size="size" @click="handleReceive(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--客户公海  学生手动流转客户 -->
      <el-table-column :label="$t('action.operation')" width='150' fixed="right" v-if="StudentManual" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--客户公海  网校客户 -->
      <el-table-column :label="$t('action.operation')" width='250' fixed="right" v-if="chinaeduCustomerSea" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button label="转到学酷" perms='customerSea:chinaedu:toxuecoo' :size="size" @click="handleCoutomersort(scope.$index, scope.row)" />
          <kt-button :label="$t('action.Receive')" :perms="permsReceive" :size="size" @click="handleReceive(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--客户公海  学酷客户 -->
      <el-table-column :label="$t('action.operation')" width='250' fixed="right" v-if="xuecooCustomerSea" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button label="转到网校" perms='customerSea:xuecoo:tochinaedu' :size="size" @click="handleCoutomersort(scope.$index, scope.row)" />
          <kt-button :label="$t('action.Receive')" :perms="permsReceive" :size="size" @click="handleReceive(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--客户公海  学校客户 -->
      <el-table-column :label="$t('action.operation')" width='250' fixed="right" v-if="SchoolCustomerSea" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('action.see')" perms='true' :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button :label="$t('action.Receive')" :perms="permsReceive" :size="size" @click="handleReceive(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 活动管理 活动连接 -->
      <el-table-column :label="$t('action.operation')" width='420' fixed="right" v-if="activityManage" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="button" label="上传海报" perms="activityManage:activity:uploadPoster" :size="size" @click="handleUp(scope.$index, scope.row)" />
          <kt-button label="生成分中心子链接" perms='activityManage:activity:activityLink' :disabled="scope.row.status==1?true:false" :size="size" @click="generateSubLink(scope.$index, scope.row)" />
          <kt-button label="复制链接" perms='activityManage:activity:copy'  v-clipboard:copy="scope.row.activityLink"    v-clipboard:success="onCopy"  v-clipboard:error="onError" :size="size" 
            />
          <kt-button type="button" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 活动管理 推广链接管理 -->
      <el-table-column :label="$t('action.operation')" width='320' fixed="right" v-if="extension" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button label="查看二维码" perms='activityManage:promoteMange:seeQRcode' :size="size" @click="toSee(scope.$index, scope.row)"  />
          <kt-button label="下载二维码" perms='activityManage:promoteMange:downloadQRcode' :size="size" @click="download(scope.$index, scope.row)" />
          <kt-button label="复制链接" perms='activityManage:promoteMange:copyCenterLink'  v-clipboard:copy="scope.row.childLink" v-clipboard:success="onCopy" v-clipboard:error="onError" :size="size"/>
        </template>
      </el-table-column>  
      <!-- 活动管理 子连接 -->
      <el-table-column :label="$t('action.operation')" width='320' fixed="right" v-if="activityChild"  header-align="center" align="center">
        <template slot-scope="scope">
            <kt-button label="复制链接" perms='activityManage:activity:copyCenterLink'  v-clipboard:copy="scope.row.centerLink"    v-clipboard:success="onCopy"  v-clipboard:error="onError" :size="size" 
            />
          <kt-button label="查看二维码" perms='activityManage:activity:seeQRcode' :size="size" @click="toSee(scope.$index, scope.row)"  />
          <kt-button label="下载二维码" perms='activityManage:activity:downloadQRcode' :size="size" @click="download(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 活动管理 咨询师推广活动连接管理 -->
      <el-table-column :label="$t('action.operation')" width='320' fixed="right" v-if="personPromoteMange"  header-align="center" align="center">
        <template slot-scope="scope">
            <kt-button label="复制链接" perms='activityManage:personPromoteMange:copyCenterLink'  v-clipboard:copy="scope.row.centerLink"    v-clipboard:success="onCopy"  v-clipboard:error="onError" :size="size" 
            />
          <kt-button label="查看二维码" perms='activityManage:personPromoteMange:seeQRcode' :size="size" @click="toSee(scope.$index, scope.row)"  />
          <kt-button label="下载二维码" perms='activityManage:personPromoteMange:downloadQRcode' :size="size" @click="download(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 活动管理 咨询师活动链接查询 -->
      <el-table-column :label="$t('action.operation')" width='420' fixed="right" v-if="ActivityPersonConsultant"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button label="复制链接" perms='activityManage:activityPersonConsultant:copyCenterLink'  v-clipboard:copy="scope.row.childLink"    v-clipboard:success="onCopy"  v-clipboard:error="onError" :size="size" 
            />
          <kt-button label="查看海报" perms='activityManage:activityPersonConsultant:seePoster' :size="size" @click="toSee2(scope.$index, scope.row)"  />
          <kt-button label="查看二维码" perms='activityManage:activityPersonConsultant:seeQRcode' :size="size" @click="toSee(scope.$index, scope.row)"  />
          <kt-button label="下载二维码" perms='activityManage:activityPersonConsultant:downloadQRcode' :size="size" @click="download(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 活动管理 招商经理活动链接查询 -->
      <el-table-column :label="$t('action.operation')" width='420' fixed="right" v-if="ActivityPerson"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button label="复制链接" perms='activityManage:activityPerson:copyCenterLink'  v-clipboard:copy="scope.row.childLink"    v-clipboard:success="onCopy"  v-clipboard:error="onError" :size="size" 
            />
          <kt-button label="查看海报" perms='activityManage:activityPerson:seePoster' :size="size" @click="toSee2(scope.$index, scope.row)"  />
          <kt-button label="查看二维码" perms='activityManage:activityPerson:seeQRcode' :size="size" @click="toSee(scope.$index, scope.row)"  />
          <kt-button label="下载二维码" perms='activityManage:activityPerson:downloadQRcode' :size="size" @click="download(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 活动管理 招商经理活动链接管理 -->
      <el-table-column :label="$t('action.operation')" width='420' fixed="right" v-if="AgentPromoteMange"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button label="复制链接" perms='activityManage:agentPromoteMange:copyCenterLink'  v-clipboard:copy="scope.row.childLink"    v-clipboard:success="onCopy"  v-clipboard:error="onError" :size="size" 
            />
          <kt-button label="查看二维码" perms='activityManage:agentPromoteMange:seeQRcode' :size="size" @click="toSee(scope.$index, scope.row)"  />
          <kt-button label="下载二维码" perms='activityManage:agentPromoteMange:downloadQRcode' :size="size" @click="download(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--  营销日历 -->
      <el-table-column :label="$t('action.operation')" width='320' fixed="right" v-if="MarketingCalendar"  header-align="center" align="center">
        <template slot-scope="scope">
            <kt-button type="text" label="编辑" :perms="permsSee" :size="size" @click="handleUpData(scope.$index, scope.row)" />
            <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
            <kt-button type="text" label="配置" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
            <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
            <kt-button type="text" label="预览" :perms="permsToSee" :size="size" @click="handleToSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!--  查看日历 -->
      <el-table-column :label="$t('action.operation')" width='320' fixed="right" v-if="MarketingCalendarFile"  header-align="center" align="center">
        <template slot-scope="scope">
            <kt-button type="text" label="编辑" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
            <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
        </template>
      </el-table-column>
       <!--  配置日历 -->
      <el-table-column :label="$t('action.operation')" width='320' fixed="right" v-if="MarketingCalendarConfig"  header-align="center" align="center">
        <template slot-scope="scope">
            <kt-button type="text" label="编辑" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
            <kt-button type="text" label="清空" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 无订单客户 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="noSignResource"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 字典类型 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="DictionaryType"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="编辑" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 字典数据 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="DictionaryData"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="编辑" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 学校字典 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="SchoolDict"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="编辑" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <!-- <kt-button type="text" :label="$t('action.see')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" /> -->
        </template>
      </el-table-column>
      <!-- 财务订单审核 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="OrderReview"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="确认收款" :perms="permsEdit"  :disabled="scope.row.isReceivables2==2?true:false" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 财务回款记录 -->
      <el-table-column :label="$t('action.operation')" width='100' fixed="right" v-if="ReturnRecord"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="确认返款" :perms="permsEdit"  :disabled="scope.row.isRefunds2==2?true:false" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 运营督导中心  分中心督导管理 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="SteeringManage"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="督导分中心" :perms="permsAdd" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteSteering(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 运营督导中心  分中心督导管理（小苔） -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="SteeringManageXT"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="督导分中心" :perms="permsAdd" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteSteering(scope.$index, scope.row)" />
        </template>
      </el-table-column>
        <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="SteeringManageXTA"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="选择" :perms="permsAdd" :size="size" @click="handleSeeA(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="SteeringManageXTB"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="移除" :perms="permsDelete" :size="size" @click="handleSeeB(scope.$index, scope.row)" />
        </template>
      </el-table-column>  
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="SteeringManageA"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="选择" :perms="permsAdd" :size="size" @click="handleSeeA(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="SteeringManageB"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="移除" :perms="permsDelete" :size="size" @click="handleSeeB(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 分配分中心资源管理 -->
      <el-table-column :label="$t('action.operation')" width='50' fixed="right" v-if="userBranchResourceAssign"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="查看" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 组织管理   三方管理 -->
      <el-table-column :label="$t('action.operation')" width='600' fixed="right" v-if="tripartiteMange"  header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('customerownership:SubcentercustomerSeaConfig:switch')"
              class="demo" 
              active-text="启用"
              inactive-text="停用" 
              v-model="scope.row.userStatus"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='1' inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>
          <kt-button :label="$t('绑定大区经理')" :perms="permsBind" :size="size" @click="handleBindManager(scope.$index, scope.row)" />
          <kt-button :label="$t('关联学校')"  :perms="permsRelationSchool" :size="size"  @click="handleRelationSchool(scope.$index, scope.row)" />
          <kt-button :label="$t('编辑')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button :label="$t('action.resetPass')" :perms="permsResetPass" :size="size" @click="handleResetpass(scope.$index, scope.row)" />
          <kt-button label="绑定学生客户来源" :perms="permsBindStudentDataFrom" :size="size" @click="bindStudentDataFrom(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 组织管理   学校账户管理 -->
      <el-table-column :label="$t('action.operation')" width='480' fixed="right" v-if="schoolAccountMange"  header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('customerownership:SubcentercustomerSeaConfig:switch')"
              class="demo" 
              active-text="启用"
              inactive-text="停用" 
              v-model="scope.row.userStatus"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='1' inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>
          <kt-button :label="$t('绑定学校')"  :perms="permsRelationSchool" :size="size"  @click="handleRelationSchool(scope.$index, scope.row)" />
          <kt-button :label="$t('编辑')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button :label="$t('action.resetPass')" :perms="permsResetPass" :size="size" @click="handleResetpass(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 资源收集池   推广资源 -->
      <el-table-column :label="$t('action.operation')" width='120' fixed="right" v-if="promote"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('同步')" :disabled='(scope.row.pushState==0||scope.row.pushState==2)?false:true' :perms="permsBind" :size="size" @click="handleReceive(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 资源收集池   招商推广资源 -->
      <el-table-column :label="$t('action.operation')" width='120' fixed="right" v-if="PromoteAgent"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('同步')" :disabled='(scope.row.pushStatus==0||scope.row.pushStatus==1)?false:true' :perms="permsBind" :size="size" @click="handleReceive(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 资源收集池   微信生态资源 -->
      <el-table-column :label="$t('action.operation')" width='120' fixed="right" v-if="WechatResources"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('同步')" :disabled='(scope.row.pushState==0||scope.row.pushState==2)?false:true' :perms="permsBind" :size="size" @click="handleReceive(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 关联学校表格 -->
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="associationSchoolA"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="选择" :perms="permsAdd" :size="size" @click="handleSeeA(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <el-table-column :label="$t('action.operation')" width='200' fixed="right" v-if="associationSchoolB"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="移除" :perms="permsDelete" :size="size" @click="handleSeeB(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 埋点配置 -->
      <el-table-column :label="$t('action.operation')" width='120' fixed="right" v-if="BuryingConfig"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button  type="text"  :label="$t('编辑')"  :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 分中心管理   分中心管理 -->
      <el-table-column :label="$t('action.operation')" width="250" fixed="right" v-if="SubCenterManage" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              class="demo" 
              v-if="hasPerms('SubCenterManage:SubCenterManage:switch')"
              active-text="开启"
              inactive-text="停用" 
              v-model="scope.row.status"
              @change="changeSwitch(scope.$index,scope.row)"  
              :active-value='1' :inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>
          <kt-button :label="$t('编辑')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button :label="$t('重置密码')" :perms="permsResetPass" :size="size" @click="handleResetpass(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 商务合作中心   添加日报 -->
      <el-table-column :label="$t('action.operation')" width="250" fixed="right" v-if="DailyPop" header-align="center" align="center">
        <template slot-scope="scope">
            <el-button
                            type="primary"
                            plain
                            perms="true"
                            :size="size"
                            @click="handleEdit(scope.row)"
                        >提交</el-button>
        </template>
      </el-table-column>
      <!-- 物料文件管理 -->
      <el-table-column :label="$t('action.operation')" width='300' fixed="right" v-if="showOperation&MaterialPackage" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('MarketingManage:MaterialPackage:switch')"
              class="demo" 
              :active-text="test1"
              :inactive-text="test2" 
              v-model="scope.row.state"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='1' inactive-value='2'
              active-color="#13ce66"
              inactive-color="#ff4949">
          </el-switch>
          <kt-button :label="$t('action.top')" type="text" perms="AuthorityManagement:PermissionsList:top" :disabled='scope.$index==0'  @click="handleTop(scope,scope.row)"/>
          <kt-button :label="$t('action.down')" type="text" perms="AuthorityManagement:PermissionsList:down" :disabled='scope.$index==data.content.length-1'  @click="handleDown(scope.$index,scope.row)"/>
          <kt-button type="text" :label="$t('编辑')" :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
          <a  :href="baseUrl+'/mediaInfo/download?id='+scope.row.mediaInfoId" target="blank" v-if="hasPerms('MarketingManage:MaterialPackage:downLoad')&&scope.row.mediaSize<300000000" :download="scope.row.name"  :disabled='true' @click="handleDownLoad(scope.$index, scope.row)" class='uploadBtn' :class="scope.row.mediaUrl?'nonedisabled':'disabled'">下载</a>
          <a :href="dominIMGUrl+'/'+scope.row.mediaUrl" target="blank" v-if="hasPerms('MarketingManage:MaterialPackage:downLoad')&&scope.row.mediaSize>=300000000" :disabled='true' class='uploadBtn' :class="scope.row.mediaUrl?'nonedisabled':'disabled'" :download="scope.row.name">下载</a> 
        </template>
      </el-table-column>
      <!-- 物料包管理 -->
      <el-table-column :label="$t('action.operation')" width='320' fixed="right" v-if="showOperation&MaterialMange" header-align="center" align="center">
        <template slot-scope="scope">
          <el-switch
              v-if="hasPerms('MarketingManage:MaterialMange:switch')"
              class="demo" 
              :active-text="test2"
              :inactive-text="test1"  
              v-model="scope.row.onlineState"
              @change="changeSwitch(scope.$index,scope.row)"  
              active-value='2' inactive-value='1'
              active-color="#ff4949"
              inactive-color="#13ce66">
          </el-switch>  
          <kt-button type="text" :label="$t('文件管理')" :perms="permsSee" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button  type="text"  :label="$t('编辑')"  :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
          <kt-button type="text" v-if='scope.row.topNum==0' :label="$t('置顶')" :perms="permsAdd" :size="size" @click="handleOrder(scope.$index, scope.row)" />
          <kt-button type="text" v-if='scope.row.topNum>0' :label="$t('取消置顶')" :perms="permsAdd" :size="size" @click="handleRemoveTop(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 文件服务器删除文件 -->
      <el-table-column :label="$t('action.operation')" width='50' fixed="right" v-if="showOperation&MaterialFileList" header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button type="text" label="删除" :perms="permsDelete" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 问卷报告 -->
      <el-table-column :label="$t('action.operation')" width='220' fixed="right" v-if="Answer"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('查看详情')"  :perms="permsEdit" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button  :label="$t('导出')"  :perms="permsExport" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 定时短信待发 -->
      <el-table-column :label="$t('action.operation')" width='50' fixed="right" v-if="SmsTiming"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('取消')" type='text' perms="true" :size="size" @click="handleEdit(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 商务合作中心  三方客户管理 -->
      <el-table-column :label="$t('action.operation')" width='80' fixed="right" v-if="SchoolCustomerSea2"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :label="$t('查看跟进')" type='text' perms="true" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 营销订单列表 -->
      <el-table-column :label="$t('action.operation')" width='80' fixed="right" v-if="ActivityOrderInfo"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button :disabled='!scope.row.ts' v-if='scope.row.businessType==1||scope.row.payStatus==3':label="scope.row.ts?scope.row.ts:'推送成功'" type='text' perms="true" :size="size" @click="handleSee(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 1对1商品下单 -->
      <el-table-column :label="$t('action.operation')" width='80' fixed="right" v-if="TsCheckOrder"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button label="删除" type='text' perms="true" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      <!-- 总订单列表 -->
      <el-table-column :label="$t('action.operation')" width='300' fixed="right" v-if="OrderList"  header-align="center" align="center">
        <template slot-scope="scope">
          <kt-button label="查看" type='text' perms="true" :size="size" @click="handleSee(scope.$index, scope.row)" />
          <kt-button label="编辑"  type='text' perms="true" :size="size" @click="handleEdit(scope.$index, scope.row)" />
          <kt-button label="审核" :disabled='scope.row.examineState==1' type='text' perms="true" :size="size" @click="handleToSee(scope.$index, scope.row)" />
          <kt-button label="改单申请" type='text' perms="true" :size="size" @click="handleDeleteDic(scope.$index, scope.row)" />
          <kt-button label="退单申请" type='text' perms="true" :size="size" @click="handleCoutomersort(scope.$index, scope.row)" />
        </template>
      </el-table-column>
      
    </el-table>
    
    <!--分页栏-->
    <div class="toolbar" style="padding:10px;">
    <!-- <div class="toolbar" style="padding:10px;">   -->
      <el-pagination 
        :layout='sizes?layout:layout2'
        @current-change="refreshPageRequest" v-if="order"
        @size-change='sizeChange'
        :current-page="pageRequest.pageNum" 
        :page-size="pageRequest.pageSize" 
        :total="parseInt(data.totalSize)?parseInt(data.totalSize):0"
        style="float:right;">
      </el-pagination>
    </div>
  </div>
  
</template>

<script>
import CrmSwitch from "@/views/Core/CrmSwitch";
import KtButton from "@/views/Core/KtButton";
import { hasPermission } from '@/permission/index.js'
export default {
  name: "CrmTable",
  components: {
    KtButton,
    CrmSwitch
  },
  props: {
    value:{
      type:String,
    },
    perms: {  // 按钮权限标识，外部使用者传入
      type: String,
      default: null
    },
    test1:{
      type: String,
      default: '解锁'
    },
    test2:{
      type: String,
      default: '锁定'
    },
    baseUrl:String,
    columns: Array, // 表格列配置
    data: Object, // 表格分页数据
    permsSee:String,//查看按钮标识
    permsAudit:String,//审核按钮
    permsEdit: String, // 编辑权限标识
    permsDelete: String, // 删除权限标识
    permsOutbound:String,//外呼标识
    permsPresentation:String,//报单标识
    permsFollow:String,//跟进标识
    permsReport:String,//报备
    permsBind:String,//绑定大区经理标识
    permsReceive:String,//领取标识
    permsProprt:String,//配比标识
    reserveSelection:Boolean,
    permsResetPass: String,// 重置密码权限标识
    permsRelationSchool:String,//关联学校权限标识
    permsCheckOrder:String,
    permsDownLoad:String,
    permsToSee:String,
    permsExport:String,
    permsAdd:String,
    person: Boolean,
    permsBindStudentDataFrom:String,
    customerstu: Boolean,
    customerschool: Boolean,
    customerChinaedu: Boolean,
    MaterialPackage:Boolean,
    ResourceDivisionstu:Boolean,
    ResourceDivisionschool:Boolean,
    ResourceDivisionchinaedu:Boolean,
    ResourceDivisionxuecoo:Boolean,
    customerdistributionstu:Boolean,
    SchoolResourcesOrder:Boolean,
    customerxuecoo:Boolean,
    customerdistributionschool:Boolean,
    customerdistributionchinaedu:Boolean,
    customerdistributionxuecoo:Boolean,
    Subcentercustomer:Boolean,
    Subcentercustomerall:Boolean,
    Proportioning:Boolean,
    HeadquartersStu:Boolean,
    Subcenter:Boolean,
    Subcentercustomersea:Boolean,
    twoCcenter:Boolean,
    see:Boolean,
    width: String,
    Outgoingrecordstu:Boolean,
    Mycustomerstudent:Boolean,
    SchoolResources:Boolean,
    Mycustomerschool:Boolean,
    Mycustomerchianedu:Boolean,
    CustomerFollowlogstu:Boolean,
    CustomerFollowlogschool:Boolean,
    CustomerFollowlogchinaedu:Boolean,
    CustomerFollowlogxuecoo:Boolean,
    studentCustomerSea:Boolean,
    CustomerdistributionChinaedu:Boolean,
    CustomerdistributionXuecoo:Boolean,
    SubcentercustomerSeaConfig:Boolean,
    Mycustomerxuecoo:Boolean,
    PersonPromoteAgent:Boolean,
    chinaeduCustomerSea:Boolean,
    SchoolCustomerSea:Boolean,
    SchoolCustomerSea2:Boolean,
    xuecooCustomerSea:Boolean,
    activityManage:Boolean,
    activityChild:Boolean,
    ActivityPerson:Boolean,
    noSignResource:Boolean,
    DictionaryType:Boolean,
    DictionaryData:Boolean,
    SchoolDict:Boolean,
    OrderReview:Boolean,
    ReturnRecord:Boolean,
    SteeringManage:Boolean,
    SteeringManageA:Boolean,
    SteeringManageB:Boolean,
    SteeringManageXT:Boolean,
    SteeringManageXTA:Boolean,
    SteeringManageXTB:Boolean,
    userBranchResourceAssign:Boolean,
    tripartiteMange:Boolean,
    schoolAccountMange:Boolean,
    promote:Boolean,
    PromoteAgent:Boolean,
    associationSchoolA:Boolean,
    associationSchoolB:Boolean,
    extension:Boolean,
    SubCenterManage:Boolean,
    BuryingConfig:Boolean,
    WechatResources:Boolean,
    SchoolAudit:Boolean,
    MarketingCalendar:Boolean,
    MarketingCalendarFile:Boolean,
    MarketingCalendarConfig:Boolean,
    MaterialMange:Boolean,
    dominIMGUrl:String,
    MaterialFileList:Boolean,
    Answer:Boolean,
    StudentManual:Boolean,
    ActivityPersonConsultant:Boolean,
    personPromoteMange:Boolean,
    AgentPromoteMange:Boolean,
    SmsTiming:Boolean,
    seeSchoolTracking:Boolean,
    MyThree:Boolean,
    DailyPop:Boolean,
    ExpireSubcenter:Boolean,
    Daily:Boolean,
    ActivityOrderInfo:Boolean,
    TsCheckOrder:Boolean,
    OrderList:Boolean,
    size: {
      // 尺寸样式
      type: String,
      default: "mini"
    },
    check:{
      //是否显示多选框
      type:Boolean,
      default:true
    },
    // 是否显示分页
    order:{
      type:Boolean,
      default:true
    },
    sizes:{
      type:Boolean,
      default:true
    },
    align: {
      // 文本对齐方式
      type: String,
      default: "left"
    },
    maxHeight: {
      // 表格最大高度
      type: Number,
      default: 9000
    },
    showOperation: {
      // 是否显示操作组件
      type: Boolean,
      default: true
    },
    border: {
      // 是否显示边框
      type: Boolean,
      default: false
    },
    stripe: {
      // 是否显示斑马线
      type: Boolean,
      default: true
    },
    highlightCurrentRow: {
      // // 是否高亮当前行
      type: Boolean,
      default: true
    },
    switchValue:{
      type:Boolean,
      default:false
    },
    showOverflowTooltip: {
      // 是否单行显示
      type: Boolean,
      default: true
    },
    showBatchDelete: {
      // 是否显示操作组件
      type: Boolean,
      default: true
    },
    loading:{
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      // 分页信息
      pageRequest: {
        pageNum: 1,
        pageSize: 30
      },
      pageRequest2: {
        pageNum: 1,
        pageSize: 30
      },
      layout:"total, sizes, prev, pager, next, jumper",
      layout2:"total, prev, pager, next, jumper",
      // loading: false, // 加载标识
      selections: [] // 列表选中列
    };
  },
  methods: {
     // 分页查询
    findPage: function () {
        // this.loading = true
        let callback = res => {
          // this.loading = false
        }
      this.$emit('findPage', {pageRequest:this.pageRequest, callback:callback})
      Functiong.prototype.call=function(conteext){
        if(){}
      }
    },
    findPage2: function () {
        // this.loading = true
        let callback = res => {
          // this.loading = false
        }
      this.$emit('findPage2', {pageRequest:this.pageRequest2, callback:callback})
    },
    findPage3: function () {
        // this.loading = true
        let callback = res => {
          // this.loading = false
        }
      this.$emit('findPage3', {pageRequest:this.pageRequest2, callback:callback})
    },
    //switch开关
    changeSwitch:function (index,row) {
      this.$emit('changeSwitch', {index:index, row:row})
    },
    changeSwitchs:function (index,row) {
      this.$emit('changeSwitchs', {index:index, row:row})
    },
    // 选择切换
    selectionChange: function (selections) {
      this.selections = selections
      this.$emit('selectionChange', {selections:selections})
    },
    // 选择切换
    handleCurrentChange: function (val) {
      this.$emit('handleCurrentChange', {val:val})
    },
    sortChange:function(index,row){
      this.$emit('sortChange', {index:index, row:row})
    },
    handleCellClick:function(index,row){
      this.$emit('handleCellClick', {index:index, row:row})
    },
    // 换页刷新
		refreshPageRequest: function (pageNum) {
      this.$emit('refreshPageRequest',pageNum)
      this.pageRequest.pageNum = pageNum
      this.pageRequest2.pageNum = pageNum
      this.findPage()
      this.findPage2()
    },
    // 页数更改刷新
    sizeChange:function(pageSize){
      this.$emit('sizeChange',pageSize)
      this.pageRequest.pageSize = pageSize
      this.pageRequest2.pageSize = pageSize
      this.findPage()
      this.findPage2()
    },
    // 编辑
    handleEdit: function(index, row) {
      this.$emit("handleEdit", { index: index, row: row });
    },
    // 当客户为A类时变红色
    rowStyle:function(row, rowIndex){
      let rowStyle={}
      if(row.row.type==='A类'||row.row.type==='1'){
        rowStyle.color='red'
        return rowStyle
      }else if(row.row.customerType==='A'){
        rowStyle.color='red'
        return rowStyle
      }else if(row.row.leixing==='A类意向客户'){
        rowStyle.color='red'
        return rowStyle
      }
      // 当有小额付费显示蓝色
      if(row.row.keyWordsType){
        rowStyle.color='#0A1DED'
        return rowStyle
      }
      // 当小程序进来的
      if(row.row.activityCodestr2){
        rowStyle.color='green'
        return rowStyle
      }
    },
    rowKey(row){

      // if(row.row.klassTypeCode){
        return row.id
      // }
    },
    handleSee:function(index, row){
      this.$emit("handleSee", { index: index, row: row });
    },
    handleUpData:function(index, row){
      this.$emit("handleUpData", { index: index, row: row });
    },
    handleUp:function(index, row){
      this.$emit("handleUp", { index: index, row: row });
    },
    // 预览
    handleToSee:function(index, row){
      this.$emit("handleToSee", { index: index, row: row });
    },
    handleSeeA(index, row){
      this.$emit("handleSeeA", { index: index, row: row });
    },
    handleSeeB(index, row){
      this.$emit("handleSeeB", { index: index, row: row });
    },
    handleCoutomersort:function(index, row){
      this.$emit("handleCoutomersort", { index: index, row: row });
    },
    // 删除
    handleDelete: function(index, row) {
      this.delete(row.id);
    },
    handleDeleteDic:function(index, row) {
      this.$emit("handleDeleteDic", { index: index, row: row });
    },
    handleDownLoad:function(index,row){
      this.$emit("handleDownLoad", { index: index, row: row });
    },
    // 批量删除
    handleBatchDelete: function() {
      let ids = this.selections.map(item => item.id).toString();
      this.delete(ids);
    },
    // 报单
    handleOrder:function(index, row){
      this.$emit("handleOrder", { index: index, row: row });
    },
    handleResetpass:function(index, row) {
      this.$emit("handleResetpass", { index: index, row: row });
    },
    handleRelationSchool:function(index, row){
      this.$emit("handleRelationSchool", { index: index, row: row });
    },
    handleBindManager:function(index, row){
      this.$emit("handleBindManager", { index: index, row: row });
    },
    bindStudentDataFrom(index, row){
      this.$emit("bindStudentDataFrom", { index: index, row: row });
    },
    // 领取
    handleReceive:function(index,row){
      this.$emit("handleReceive",{index:index,row:row})
    },
    //查看跟进情况
    handleFollow(index,row){
      this.$emit("handleFollow", { index: index, row: row });
    },
    handleDeleteSteering(index,row){
      this.$emit("handleDeleteSteering", { index: index, row: row });
    },
    // 提交审核
    handleAudit(index,row){
      this.$emit("handleAudit", { index: index, row: row });
    },
    // 审核驳回
    handleAudit2(index,row){
      this.$emit("handleAudit2", { index: index, row: row });
    },
    // 删除操作
    delete: function(ids) {
      this.$confirm("确认删除选中记录吗？", "提示", {
        type: "warning"
      })
        .then(() => {
          let params = [];
          let idArray = (ids + "").split(",");
          for (var i = 0; i < idArray.length; i++) {
            params.push({ id: idArray[i] });
          }
          this.loading = true;
          let callback = res => {
            if (res.code == 200) {
              this.$message({ message: "删除成功", type: "success" });
              this.findPage();
            } else {
              this.$message({ message: "操作失败, " + res.msg, type: "error" });
            }
            this.loading = false;
          };
          this.$emit("handleDelete", { params: params, callback: callback });
        })
        .catch(() => {});
    },
    ProportioningPop:function(index,row){
      this.$emit("ProportioningPop", { index: index, row: row });
    },
    // 外呼
    handleoutbound:function(index,row){
      this.$emit("handleoutbound", { index: index, row: row });
    },
    // 跟进
    handleFollow:function(index,row){
      this.$emit("handleFollow",{index:index,row:row})
    },
    handleReport:function(index,row){
      this.$emit("handleReport",{index:index,row:row})
    },
    // 下载二维码
    download:function(index, row){
      this.$emit("download",{index:index,row:row})
    },
    // 查看二维码
    toSee:function(index, row){
      this.$emit("toSee",{index:index,row:row})
    },
    toSee2:function(index, row){
      this.$emit("toSee2",{index:index,row:row})
    },
    // 生成子链接
    generateSubLink(index, row){
      this.$emit("generateSubLink",{index:index,row:row})
    },
    // 复制子链接
    copySubLink(index, row){
      this.$emit("copySubLink",{index:index,row:row})
    },
    onCopy: function (e) {
      this.$emit("onCopy",e)
    },
    onError: function (e) {
      this.$emit("onError",e)
    },
    hasPerms: function (perms) {
      // 根据权限标识和外部指示状态进行权限判断
      return hasPermission(perms)
    },
    // 向上
    handleTop:function(index,row){
      this.$emit('handleTop',{index:index,row:row})
    },
    // 向下
    handleDown:function(index,row){
      this.$emit('handleDown',{index:index,row:row})
    },
    handleRemoveTop:function(index,row){
      this.$emit('handleRemoveTop',{index:index,row:row})
    }
  },
  mounted() {
    this.refreshPageRequest(1);
  }
};
</script>

<style scoped>
.active{
  color: red !important;
}
.fl {
  float: left;
}
.demo /deep/ .el-switch__label {
  position: absolute;
  display: none;
  color: #fff;
}
.demo /deep/ .el-switch__label--left {
  z-index: 9;
  left: 20px;
}
.demo /deep/ .el-switch__label--right {
  z-index: 9;
  left: -5px;
}
.demo /deep/ .el-switch__label.is-active {
  display: block;
}
.demo /deep/  .el-switch__core{
  width: 58px!important;
}
.uploadBtn{
  font-size: 12px;
  color: #1A7284;
  text-decoration: none;
}
.disabled{
  pointer-events: none;
  color: #ccc;
}
</style>
<style>
  .el-table .warning-row {
    background: oldlace;
  }

  .el-table .success-row {
    background: #f0f9eb;
  }
</style>
